package com.zzm.validate.web.injector;

import org.apache.commons.validator.Arg;
import org.apache.commons.validator.Field;
import org.apache.commons.validator.Form;

public class ResourceArgInjector extends ArgInjector {
	
	public ResourceArgInjector() {
		this.setInjectKey("resource");
	}

	@Override
	public String inject(Object bean, Form form, Field field, Arg arg,
			String message) {
		if(!injectable(arg)) {
			return message;
		}
		String resource = this.getFormValidatorStub().getDefaultBundle().getString(arg.getBundle());
		return this.inject(message, arg, resource);
	}

}
